﻿Public Class PermissaoBLL

#Region "Propriedades"
    Property ususario As Integer
    Property litens As New List(Of MenuUsuarioBLL)
#End Region


#Region "Inserir Itens"
    Sub InserirItens()
        Try
            excluiritens()
            For Each item As MenuUsuarioBLL In litens
                item.usu_codigo = Me.ususario
                item.inserir()
            Next
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

#End Region

#Region "Excluir ItensCompra"
    Sub excluiritens()
        Dim item As New MenuUsuarioBLL
        item.usu_codigo = Me.ususario
        item.excluir()
    End Sub
#End Region


#Region "Buscar ItensMenu"
    Public Function buscaritens() As DataTable
        Dim tab As New DataTable
        Try
            Dim objitens As New MenuUsuarioBLL
            tab = objitens.localizar(Me.ususario, 1)
        Catch ex As Exception
            Throw New Exception("Erro ao localizar lista de itens")
        End Try
        Return tab

    End Function
#End Region
End Class
